package com.example.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
* <p>
* 字典表
* </p>
*
* @author wsl
* @since 2022-04-01
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "Dict对象", description = "字典表")
public class Dict implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("字典编号")
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty(value = "字典编号",index = 0)
    @JsonInclude(JsonInclude.Include.ALWAYS)
    private Integer id;

    @ApiModelProperty("字典名称")
    @ExcelProperty(value = "字典名称",index = 1)
    private String name;

    @ApiModelProperty("字典编码")
    @ExcelProperty(value = "字典编码",index = 2)
    private String code;

    @ApiModelProperty("值")
    private Integer value;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("父编号")
    private Integer parentId;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private LocalDateTime updateTime;

    @ApiModelProperty("是否启用")
    private Integer enabled;

    @ApiModelProperty("是否删除")
    private Integer deleted;

    @ApiModelProperty("是否包含子节点")
    @TableField(exist = false)
    private Boolean hasChildren;

    @ApiModelProperty("子节点")
    @TableField(exist = false)
    private List<Dict> children;
}
